<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html:html>
<head>
<title><bean:message key="welcome.title"/></title>
<link rel="stylesheet" href="<%=request.getContextPath() %>/default.css" type="text/css">
<html:base/>
</head>
<body>

<div id="header">
	<div id="logo">
		<h1>
			<html:img width="40" src="../images/EMPTY.GIF"/>
			<html:link page="/pages/home.jsp">Textbook Crossroads</html:link>
		</h1>
		<h2>Team 14 - LoneTree</h2>
	</div>
	<div id="menu">
		<ul>
			<li class="active"><html:link action="/PrepForMyBooks">Dashboard</html:link></li>
			<li><html:link page="/pages/books.jsp">Books</html:link></li>
			<li><html:link page="/pages/courses.jsp">Courses</html:link></li>
			<li><html:link page="/pages/about.jsp">About</html:link></li>
			<li class="logon"><html:link action="/logout">LogOut</html:link></li> 
		</ul>
	</div>
</div>

<logic:notPresent name="org.apache.struts.action.MESSAGE" scope="application">
  <font color="red">
    ERROR:  Application resources not loaded -- check servlet container
    logs for error messages.
  </font>
</logic:notPresent>

<div id="content">
	<div id="sidebar">
			<div id="categories">
			<div id="archives" class="boxed">
				<h2>MyActions</h2>
				<div class="content">
					<ul>
			    		<li><html:link page="/PrepForMyBooks.do?manage=books">Manage MyBooks</html:link></li>
			            <li><html:link page="/PrepForMyBooks.do?manage=sections">Manage MySections</html:link></li>
			            <li><html:link action="/UpdateMyProfile">Update MyProfile</html:link></li>
					</ul>
				</div>
			</div>
		</div>
	</div>

	<div id="posts">
		<div class="post">
			<h2 class="title"><bean:message key="userdash.heading"/></h2>
			<div class="meta">
				<p class="date"> </p>
			</div>
			<div class="story">
			<p>Welcome to your Dashboard. Here you can manage your list of books, and courses sections.</p>
			</div>
		</div>
		<div class="post">
			<h2 class="title"><bean:message key="userdash.mybooks"/></h2>
			<div class="meta">
				<p class="date"></p>
			</div>
			<div class="story">
			
			<logic:present name="books">
  <logic:notEmpty name="books">
<table border="1">
  <logic:iterate id="book" name="books" indexId="cnt">
   <tr>
   <td width="70%">
	<bean:write name="book" property="title" />
	</td>
	</tr>	
	</logic:iterate> 
	</table>
	
  </logic:notEmpty>
    
    <logic:empty name="books">
    Database search does not return any result
    </logic:empty>
  
  </logic:present>
	
			</div>
		</div>
		<div class="post">
			<h2 class="title"><bean:message key="userdash.mysections"/></h2>
			<div class="meta">
				<p class="date"></p>
			</div>
			<div class="story">
			
			
		<!-- USER COURSES -->
				
<logic:present name="courses">
  <logic:notEmpty name="courses">
<table border="1">
  <logic:iterate id="course" name="courses" indexId="cnt">
   <tr>
   <td width="70%">
	<bean:write name="course" property="sectionId" />
	</td>
	</tr>
	
	</logic:iterate> 
	</table>
	
  </logic:notEmpty>
    
    <logic:empty name="courses">
    Database search does not return any result
    </logic:empty>
  
  </logic:present>
			
			
			 
			</div>
		</div>
	</div>

</div>

<div id="footer">
	<p id="copy">&copy;2007 LoneTree.</p>
	<p> (Andrew Lee | Bojan Martin | Dimeji Omikunle | Minghui Yu)</p>
</div>
</body>
</html:html>